<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                template="../layouts/100.xhtml">

    <ui:define name="heading">
        <h:outputText value="Anmeldung"/>
    </ui:define>

    <ui:define name="scripts">
        <script type="text/javascript">
            /* <![CDATA[ */
            jQuery(document).ready(function () {
                document.getElementById("account_user").focus();
            });
            /* ]]> */
        </script>
    </ui:define>

    <ui:define name="keypress">
        <script type="text/javascript">
            /* <![CDATA[ */
            jQuery(function () {
                jQuery("form#account_form input[type=text]").keypress(function (e) {
                    if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
                        jQuery('form#account_form input[type=submit]').click();
                        return false;
                    }
                    return true;
                });
            });
            jQuery(function () {
                jQuery("form#account_form input[type=password]").keypress(function (e) {
                    if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
                        jQuery('form#account_form input[type=submit]').click();
                        return false;
                    }
                    return true;
                });
            });
            jQuery(function () {
                jQuery("form#openid_form input[type=text]").keypress(function (e) {
                    if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
                        jQuery('form#openid_form input[type=submit]').click();
                        return false;
                    }
                    return true;
                });
            });
            /* ]]> */
        </script>
    </ui:define>

    <ui:define name="form">
        <h5></h5>
        <h:panelGroup rendered="#{not empty sessionScope.SPRING_SECURITY_LAST_EXCEPTION}">
            <p class="warning">
                <h:outputText value="Anmeldungsversuch fehlgeschlagen."/>
            </p>
        </h:panelGroup>
        <ui:include src="../layouts/include/validation.xhtml"/>
        <ui:insert name="messages"/>
        <ui:insert name="inset">
            <div class="inset">
                <ui:insert name="page"/>
            </div>
        </ui:insert>
    </ui:define>

    <ui:define name="icon"/>

    <ui:define name="heading">
        <h:outputText value="#{messageSource['login']}"/>
    </ui:define>

    <ui:define name="paragraphs">
        <h3>Anmelden</h3>
        <ui:include src="include/account.xhtml"/>
    </ui:define>


</ui:composition>
